﻿#ifndef DINGDANNETWORKACCESSMANAGER_H
#define DINGDANNETWORKACCESSMANAGER_H

#include "basenetworkaccessmanager.h"
#include "dingdan.h"

class DingdanNetworkAccessManager : public BaseNetworkAccessManager
{
    Q_OBJECT
public:
    explicit DingdanNetworkAccessManager(QObject *parent = nullptr);

    void saveDingdan(Dingdan &dingdan);

    void deleteDingdan(QString username, QString dingdanId);

    void getDingdans(QString username, Dingdan::DingdanType type, Dingdan::DingdanState state);

    void getDingdanDetails(QString username, QString dingdanId);

    void getDingdanDetails(
            Dingdan::FinanceWidgetType type,
            QString sourceUsername,
            QString targetUsername);

    void calculateDingdan(Dingdan &dingdan);

    void queryDingdan(
            int type,
            QString sourceUsername,
            QString targetUsername,
            QString startDate,
            QString endDate);

    void queryDingdanDetail(
            int type,
            QString sourceUsername,
            QString targetUsername,
            QString productId,
            QString startDate,
            QString endDate);

    void financeSubmit(
            QString companyId,
            QString sourceUsername,
            QString targetUsername,
            QString relatedMessageId,
            int relationType,
            int totalFinanceType,
            double curPreSave,
            double preSave,
            double financeMake,
            QList<DingdanDetail*> details);

    void getHistoryProducts(
            QString sourceCompanyId,
            QString targetCompanyId,
            QString sourceProductId,
            int type);

    void getImportDingdans(
            QString username,
            Dingdan::DingdanState state);

    void getImportDingdanDetails(
            QString sourceUsername,
            QString targetUsername,
            QString sourceCompanyId,
            QString targetCompanyId,
            QString dingdanId,
            int type);
signals:

public slots:
};

#endif // DINGDANNETWORKACCESSMANAGER_H
